package net.hands.ctx.element;

import net.hands.common.StringUtils;

/**
 * 说明: <br>
 * <p>
 * 这是一个开源的软件，请在LGPLv3下合法使用、修改或重新发布。
 * </p>
 * 
 * @title Botton.java
 * @package net.simpleframework.common.web.html.element
 * @author shihb(shihaibin.sea@gmail.com, 13466609192)
 *         <p>
 *         http://code.google.com/p/simpleframework/
 *         </p>
 *         <p>
 *         http://www.simpleframework.net
 *         </p>
 * @update 2013-1-3 下午3:35:22
 */

public class Botton extends AbstractElement<Botton> {
	private String accesskey;
	private String autofocus;
	private String className;
	private String contenteditable;
	private String datafld;
	private String dataformatas;
	private String datasrc;
	private String formnovalidate;
	private boolean hidefocus;
	private String lang;
	private String language;
	private String name;
	private String tabindex;
	private String title;
	private String type;
	private String value;

	public String getAccesskey() {
		return accesskey;
	}

	public Botton setAccesskey(String accesskey) {
		this.accesskey = accesskey;
		return this;
	}

	public String getAutofocus() {
		return autofocus;
	}

	public Botton setAutofocus(String autofocus) {
		this.autofocus = autofocus;
		return this;
	}

	public String getClassName() {
		return className;
	}

	public Botton setClassName(String className) {
		this.className = className;
		return this;
	}

	public String getContenteditable() {
		return contenteditable;
	}

	public Botton setContenteditable(String contenteditable) {
		this.contenteditable = contenteditable;
		return this;
	}

	public String getDatafld() {
		return datafld;
	}

	public Botton setDatafld(String datafld) {
		this.datafld = datafld;
		return this;
	}

	public String getDataformatas() {
		return dataformatas;
	}

	public Botton setDataformatas(String dataformatas) {
		this.dataformatas = dataformatas;
		return this;
	}

	public String getDatasrc() {
		return datasrc;
	}

	public Botton setDatasrc(String datasrc) {
		this.datasrc = datasrc;
		return this;
	}

	public String getFormnovalidate() {
		return formnovalidate;
	}

	public Botton setFormnovalidate(String formnovalidate) {
		this.formnovalidate = formnovalidate;
		return this;
	}

	public boolean isHidefocus() {
		return hidefocus;
	}

	public Botton setHidefocus(boolean hidefocus) {
		this.hidefocus = hidefocus;
		return this;
	}

	public String getLang() {
		return lang;
	}

	public Botton setLang(String lang) {
		this.lang = lang;
		return this;
	}

	public String getLanguage() {
		return language;
	}

	public Botton setLanguage(String language) {
		this.language = language;
		return this;
	}

	public String getName() {
		return name;
	}

	public Botton setName(String name) {
		this.name = name;
		return this;
	}

	public String getTabindex() {
		return tabindex;
	}

	public Botton setTabindex(String tabindex) {
		this.tabindex = tabindex;
		return this;
	}

	public String getTitle() {
		return title;
	}

	public Botton setTitle(String title) {
		this.title = title;
		return this;
	}

	public String getType() {
		return type;
	}

	public Botton setType(String type) {
		this.type = type;
		return this;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	@Override
	public String toString() {
		final StringBuilder sb = new StringBuilder();
		sb.append("<button");
		doAttri(sb);
		final String txt = getText();
		if (StringUtils.hasText(txt)) {
			sb.append(">").append(txt).append("</button>");
		} else {
			sb.append(" />");
		}
		return sb.toString();
	}

}
